#pragma once

#ifdef USE_LIBUV
#include "../core/Common.h"

struct uv_tcp_s;

namespace LuaGui {
	class TcpServer {
	public:
		TcpServer();
		~TcpServer();

		static TcpServer* GetTcpServerByUID(uint64_t uid);
		unsigned long long GetUID() { return (unsigned long long)this; }
		int Start(std::string ip = "0.0.0.0", unsigned int port = 0);
		void Stop();
	private:
		struct uv_tcp_s *m_uv_tcp;

		static std::unordered_map<uint64_t, TcpServer*> s_tcp_servers;
	};

}

#endif